package ATBMS.modles.DAO;

import java.sql.Connection;

/**
 * Create All DAO
 * @author Felix
 */
public class DAOFactory {

    /**
     * Create User DAO
     * @return
     */
    public static UserDAO getUserDAO() {

        Connection conn = DBHandle.GetConnection();
        if (conn == null) {
            return null;
        }
        return UserDAOImpl.getInstance(conn);
    }

    /**
     * Create Flight DAO
     * @return
     */
    public static FlightDAO getFlightDAO() {
        Connection conn = DBHandle.GetConnection();
        if (conn == null) {
            return null;
        }
        return FlightDAOImpl.getInstance(conn);
    }

    /**
     * Create Ticket DAO
     * @return
     */
    public static TicketDAO getTicketDAO() {
        Connection conn = DBHandle.GetConnection();
        if (conn == null) {
            return null;
        }
        return TicketDAOImpl.getInstance(conn);
    }
}
